<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('服务器编辑')" />
</head>
<body>
	<section class="content">
	    <form class="form-horizontal" id="serverDetailForm">
	        <input class="hidden" name="id" th:value="${tServerInfo.id}">
			<div class="box-body">
				<div class="form-group">
					<label for="host" class="col-sm-3 control-label">服务器host :</label>
					<div class="col-sm-4">
						<input type="text" th:value="${tServerInfo.host}" class="form-control" name="host" id="host" required  placeholder="请输入host">
					</div>
					<label for="port" class="col-sm-2 control-label">端  口 :</label>
					<div class="col-sm-2">
						<input type="text" th:value="${tServerInfo.port}" class="form-control" name="port" id="port" required  placeholder="请输入端口">
					</div>
				</div>
				<div class="form-group">
					<label for="username" class="col-sm-3 control-label">用 户 名 :</label>
					<div class="col-sm-8">
						<input type="text" th:value="${tServerInfo.username}" class="form-control" name="username" id="username" required  placeholder="请输入用户名">
					</div>
				</div>
				<div class="form-group">
					<label for="password" class="col-sm-3 control-label">密   码 :</label>
					<div class="col-sm-8">
						<input type="text" th:value="${tServerInfo.password}" class="form-control" name="password" id="password" required  placeholder="请输入密码">
					</div>
				</div>
				<div class="form-group">
					<label for="passsalt" class="col-sm-3 control-label">混淆密码 :</label>
					<div class="col-sm-8">
						<input type="text" th:value="${tServerInfo.passsalt}" class="form-control" name="passsalt" id="passsalt" required  placeholder="请输入密码">
					</div>
				</div>
			</div>
	    </form>
    </section>
    <th:block th:include="include :: footer" />
    <script>
        function submitHandler() {
			if($("#serverDetailForm").validate().form()){
                $.common.postAjax("/serverCon/edit",$("#serverDetailForm").serialize(),function (data) {
                    if(data.code == 0){
                    	parent.layer.closeAll('iframe'); // 关闭当前frame
						parent.$.table.refreshTable();
						parent.toastr.success(data.msg);
					} else {
						parent.toastr.error(data.msg);
					}
                })
            }
        }
    </script>
</body>
</html>